<!--
 * @Author: your name
 * @Date: 2020-09-08 10:01:50
 * @LastEditTime: 2021-07-30 16:54:46
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /vue-element-admin-son/src/views/businessPage/dashboard/admin/index.vue
-->
<template>
  <div class="dashboard-editor-container">

    <h1>子应用-测试页面3</h1>
    <div>主应用下发的消息: {{ '主应用点击按钮 ' + token + ' 下'|| '暂无' }}</div><br>
    <div>获取本地localstorage: {{ userInfo===null?'暂无':userInfo.username }}</div>

  </div>
</template>

<script>

export default {
  name: 'DashboardAdmin',
  data() {
    return {
      token: null,
      userInfo: JSON.parse(localStorage.getItem('userInfo'))
    }
  },
  mounted() {
    this.$MicroMount.onGlobalStateChange(state => {
      const { token } = state
      this.token = token
    }, true)
  }
}
</script>

<style lang="scss" scoped>
.dashboard-editor-container {
  padding: 32px;
  background-color: rgb(240, 242, 245);
  position: relative;

  .github-corner {
    position: absolute;
    top: 0px;
    border: 0;
    right: 0;
  }

  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 32px;
  }
}

@media (max-width:1024px) {
  .chart-wrapper {
    padding: 8px;
  }
}
</style>
